<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/pages/templates/TemplateAdmin.xhtml">

	<ui:define name="titre">Comme au resto</ui:define>
	<ui:define name="profils">
	<br/>
		<h:form id="formBoutons">
    			<p:commandButton value="Administrateur"
				actionListener="#{ConnexionMb.switch2Admin}" ajax="true" disable = "#{AdminMB.estAdministrateur}"  />  
    			<p:commandButton value="Restaurateur"
				actionListener="#{ConnexionMb.switch2Resto}" ajax="true" disable = "#{AdminMB.estRestaurateur}" />  
    			<p:commandButton value="Client"
				actionListener="#{ConnexionMb.switch2Client}" ajax="true" disable = "#{AdminMB.estClient}"/>  
			</h:form>
	</ui:define>
	<ui:define name="content">
		<h:head></h:head>
		<h:body>
			<h:form id="form">
				<p:growl id="msgs" showDetail="true" />
				<p:dataTable id="restos" var="r"
					value="#{listeRestaurantAdminMB.listeRestaurants}">

					<p:column headerText="Restaurants" style="width:70%">
						<h:outputText value="#{r.nom}" />
					</p:column>
					<p:column style="width:30%">
						<p:commandButton id="selectButton" 
							action="#{listeRestaurantAdminMB.modifieRestau}"
							icon="ui-icon-search" title="View">
							<f:setPropertyActionListener value="#{r.id}"
								target="#{listeRestaurantAdminMB.idSelRestaurant}" />
						</p:commandButton>
					</p:column>
				</p:dataTable>
				<br/>
				<p:commandButton value="Nouveau restaurant" action="#{listeRestaurantAdminMB.nouveauRestau}" />
				<p:commandButton value="Supprimer le restaurant" action="#{listeRestaurantAdminMB.supprimeRestau}" />
			</h:form>
		</h:body>	
	</ui:define>
</ui:composition>
